<?php   
/********************************************
*
********************************************/

class Publicity extends Controller {

    function Publicity()
    {
        parent::Controller();    
        $this->load->model('publicitymodel'); 
        $this->load->model('glossarymodel');
    }
    
    function index()
    {
        
        //publicity item
        $data["publicity_item"] = $this->publicitymodel->get_latest_publicity_item();   

        //publicity list                                          
        $data["grouped_list"] = $this->publicitymodel->get_list();


        $this->load->view('website/default/head', array("document_title" => DOCUMENT_TITLE . "Publicity"));  
        $this->load->view('website/default/header');  
        $this->load->view('website/publicity/publicity', $data);   
        $this->load->view('website/default/footer');   

    }

    function month($month = '')
    {                                                                      

        //publicity list
        $data["grouped_list"] = $this->publicitymodel->get_list($month); 
        if (empty($data["grouped_list"])) show_404(); 

        //activate layout variant for 'month page'
        $data["use_month_layout"] = TRUE;


        $this->load->view('website/default/head', array("document_title" => DOCUMENT_TITLE . "Publicity"));  
        $this->load->view('website/default/header');  
        $this->load->view('website/publicity/publicity', $data);   
        $this->load->view('website/default/footer');   

    }

    function view($id = NULL)
    {
                                                                           
        //publicity item
        $data["publicity_item"] = $this->publicitymodel->get_item($id); 
        if (empty($data["publicity_item"])) show_404();                                              

        //publicity list
        $data["grouped_list"] = $this->publicitymodel->get_list();      

        $this->load->view('website/default/head', array("document_title" => DOCUMENT_TITLE . "Publicity - " .$data["publicity_item"]["Title_Publicity"]));   
        $this->load->view('website/default/header');  
        $this->load->view('website/publicity/publicity_detail', $data);   
        $this->load->view('website/default/footer');   

    }
}

/* End of file welcome.php */
/* Location: ./system/application/controllers/welcome.php */